package top.ninwoo.utils.config;

import com.spotify.docker.client.DefaultDockerClient;
import com.spotify.docker.client.DockerClient;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

import java.net.URI;

@Configuration
@ComponentScan("top.ninwoo.utils")
@EnableConfigurationProperties(UtilsProperties.class)
public class CNFUtilsAutoConfiguration {
    @Bean(destroyMethod = "close")
    public DockerClient dockerClient() {
        return DefaultDockerClient.builder()
                .uri(URI.create("http://127.0.0.1:2375"))
                .build();
    }
}
